<ul class="submenu">
<li><?php echo $this->Html->link('View',array('action' => 'index')); ?></li>
<li><?php echo $this->Html->link('New',array('action' => 'add')); ?></li>
</ul>

<table>
    <tr>
        <th>Id</th>
        <th>Name</th>
        <th>State</th>
        <th>Action</th>
        <th>Modified</th>
        <th>Created</th>
    </tr>

    <!-- Here is where we loop through our $posts array, printing out post info -->

    <?php foreach ($departments as $department): ?>
    <tr>
        <td><?php echo $department['Department']['id']; ?></td>
        <td><?php echo $this->Html->link($department['Department']['title'],
				array('controller' => 'departments', 'action' => 'edit', $department['Department']['id'])); ?>
        </td>
        <td><?php echo $department['Department']['publish']; ?></td>
        <td><?php echo $this->Form->postLink('Delete',
                array('action' => 'delete', $department['Department']['id']),
                array('confirm' => 'Are you sure you want to delete this department?'));
            ?>
            
        </td>
        <td><?php echo $department['Department']['modified']; ?></td>
        <td><?php echo $department['Department']['created']; ?></td>
    </tr>
    <?php endforeach; ?>
    <?php unset($department); ?>
</table>